<div class="tabs ui-tabs ui-widget ui-widget-content ui-corner-all">
  <ul class="tab-menu ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
    <li class="ui-state-default ui-corner-top <?php echo empty($type) || $type == 'account' ? 'ui-tabs-selected ui-state-active' : '' ?>">
      <a href="#user-details-tab">
        <span><?php echo $this->lang->line('label.' . $this->router->fetch_class() . '.account') ?></span>
      </a>
    </li>
    <li class="ui-state-default ui-corner-top <?php echo $type == 'profile' ? 'ui-tabs-selected ui-state-active' : '' ?>">
      <a href="#user-provider-tab">
        <span><?php echo $this->lang->line('label.' . $this->router->fetch_class() . '.profile') ?></span>
      </a>
    </li>
    <li class="ui-state-default ui-corner-top <?php echo $type == 'download' ? 'ui-tabs-selected ui-state-active' : '' ?>">
      <a href="#user-download-tab">
        <span><?php echo $this->lang->line('label.' . $this->router->fetch_class() . '.download') ?></span>
      </a>
    </li>
    <li class="ui-state-default ui-corner-top <?php echo $type == 'favorite' ? 'ui-tabs-selected ui-state-active' : '' ?>">
      <a href="#user-favorite-tab">
        <span><?php echo $this->lang->line('label.' . $this->router->fetch_class() . '.favorite') ?></span>
      </a>
    </li>
  </ul>
  <!-- Content tab -->
  <div id="user-details-tab" class="form_inputs ui-tabs-panel ui-widget-content ui-corner-bottom">
    <fieldset>
      <ul>
        <li class="even">
          <label for="first_name">
            <?php echo $this->lang->line('label.user.first_name') ?>
          </label>
          <div class="input">
            <?php echo empty($obj['first_name']) ? '' : $obj['first_name'] ?>
          </div>
        </li>
        <li>
          <label for="last_name"><?php echo $this->lang->line('label.user.last_name') ?></label>
          <div class="input">
            <?php echo empty($obj['last_name']) ? '' : $obj['last_name'] ?>
          </div>
        </li>
        <li>
          <label for="username"><?php echo $this->lang->line('label.user.username') ?> </label>
          <div class="input">
            <?php echo empty($obj['username']) ? '' : $obj['username'] ?>
          </div>
        </li>
        <li class="even">
          <label for="display_name"><?php echo $this->lang->line('label.user.display_name') ?></label>
          <div class="input">
            <?php echo empty($obj['display_name']) ? '' : $obj['display_name'] ?>
          </div>
        </li>
        <li>
          <label for="group_id"><?php echo $this->lang->line('label.user.group') ?></label>
          <div class="input">
            <a href="<?php echo site_url('admin/'."group/show/" . $obj["group_id"]) ?>">
              <?php echo $this->group_model->to_string($obj["group_id"]) ?></a>
          </div>
        </li>
        <li>
          <label for="ip_address"><?php echo $this->lang->line('label.user.ip_address') ?></label>
          <div class="input"><?php echo $obj["ip_address"] ?>
          </div>
        </li>
        <li>
          <label for="is_active"><?php echo $this->lang->line('label.user.is_active') ?></label>
          <div class="input"><?php echo $obj["is_active"] ?>
          </div>
        </li>
        <li>
          <label for="active_code"><?php echo $this->lang->line('label.user.active_code') ?></label>
          <div class="input"><?php echo $obj["active_code"] ?>
          </div>
        </li>
        <li>
          <label for="created_on"><?php echo $this->lang->line('label.user.created_on') ?></label>
          <div class="input">
            <?php echo empty($obj["created_on"]) ? '' : date($this->setting_model->item('date_format'), $obj["created_on"]) ?>
          </div>
        </li>
        <li>
          <label for="last_login"><?php echo $this->lang->line('label.user.last_login') ?></label>
          <div class="input">
            <?php echo empty($obj["last_login"]) ? '' : date($this->setting_model->item('date_format'), $obj["last_login"]) ?>
          </div>
        </li>
        <li>
          <label for="salt"><?php echo $this->lang->line('label.user.salt') ?></label>
          <div class="input"><?php echo $obj["salt"] ?>
          </div>
        </li>
        <li>
          <label for="first_name"><?php echo $this->lang->line('label.user.first_name') ?></label>
          <div class="input"><?php echo $obj["first_name"] ?>
          </div>
        </li>
        <li>
          <label for="last_name"><?php echo $this->lang->line('label.user.last_name') ?></label>
          <div class="input"><?php echo $obj["last_name"] ?>
          </div>
        </li>
        <li>
          <label for="display_name"><?php echo $this->lang->line('label.user.display_name') ?></label>
          <div class="input"><?php echo $obj["display_name"] ?>
          </div>
        </li>
      </ul>
    </fieldset>
  </div>
  <div id="user-provider-tab" class="form_inputs ui-tabs-panel ui-widget-content ui-corner-bottom">
    <fieldset>
      <ul>        
        <li>
          <label for="email"><?php echo $this->lang->line('label.end_user.email') ?></label>
          <div class="input"><?php echo empty($obj["email"]) ? "" : $obj["email"] ?>
          </div>
        </li>
        <li>
          <label for="phone"><?php echo $this->lang->line('label.end_user.phone') ?></label>
          <div class="input"><?php echo empty($obj["phone"]) ? "" : $obj["phone"] ?>
          </div>
        </li>
        <li>
          <label for="address"><?php echo $this->lang->line('label.end_user.address') ?></label>
          <div class="input">
            <?php echo empty($obj["address"]) ? "" : $obj["address"] ?>
          </div>
        </li>
        <li>
          <label for="status"><?php echo $this->lang->line('label.end_user.status') ?></label>
          <div class="input">
            <?php $status_array = array(
                  PROFILE_STATUS_BLOCK => $this->lang->line('label.profile.status.block'),
                  PROFILE_STATUS_ACTIVE => $this->lang->line('label.profile.status.active'),
                  PROFILE_STATUS_UNACTICE => $this->lang->line('label.profile.status.unactive')); 
            echo @$status_array[$obj['status']]; ?>
          </div>
        </li>
        <li>
          <label for="country_id"><?php echo $this->lang->line('label.end_user.country_id') ?></label>
          <div class="input">            
            <a href="<?php echo site_url('admin/'."country/show/" . $obj["country_id"]) ?>">
              <?php echo $this->country_model->to_string($obj["country_id"]) ?>
            </a>
          </div>
        </li>
        <li>
          <label for="city_id"><?php echo $this->lang->line('label.end_user.city_id') ?></label>
          <div class="input">
            <a href="<?php echo site_url('admin/'."country/show/" . $obj["city_id"]) ?>">
              <?php echo $this->city_model->to_string($obj["city_id"]) ?>
            </a>
          </div>
        </li>
        <li>
          <label for="avatar">
            <?php echo $this->lang->line('label.end_user.avatar') ?></label>
          <div class="input">
            <img width="200px" alt="avatar"
                 src="<?php echo site_url('admin/file_upload/get_img_from_path?path=' .
                    $this->router->fetch_class() . '/' . $obj['avatar']) ?>" />
          </div>
        </li>
      </ul>
    </fieldset>
  </div>
  <?php $status = array(
                PROMOTION_NEW => $this->lang->line('label.promotion.status.new'),
                PROMOTION_PEDDING => $this->lang->line('label.promotion.status.pedding'),
                PROMOTION_APPROVED => $this->lang->line('label.promotion.status.approve'),
                PROMOTION_PUBLISH => $this->lang->line('label.promotion.status.publish'),
                PROMOTION_REJECT => $this->lang->line('label.promotion.status.reject'),
                PROMOTION_BLOCK => $this->lang->line('label.promotion.status.block')); ?>
  <div id="user-download-tab" class="form_inputs ui-tabs-panel ui-widget-content ui-corner-bottom">
    <fieldset>
      <ul>
        <table border="0" class="table-list">
          <thead>
            <tr>
              <th><?php echo $this->lang->line("label.promotion_download.promotion_id") ?></th>
              <th><?php echo $this->lang->line("label.promotion_download.date_create") ?></th>
              <th><?php echo $this->lang->line("label.promotion_download.code") ?></th>
              <th><?php echo $this->lang->line("label.promotion_download.num_get") ?></th>
              <th><?php echo $this->lang->line("label.promotion_download.status") ?></th>
            </tr>
          </thead>
          <tbody>
            <?php foreach ($download_promotions as $obj) { ?>
              <tr>
                <td>
                  <?php
                  $ref_obj = $this->promotion_model->get($obj["promotion_id"]);
                  if ($ref_obj) {
                    ?>
                    <a href="<?php echo site_url('admin/'."promotion/show/" . $obj["promotion_id"]) ?>">
                      <?php echo $this->promotion_model->to_string($ref_obj) ?></a>
                  <?php } ?>
                </td><td>
                  <?php echo empty($obj["date_create"]) ? '' : date($this->setting_model->item('date_format'), $obj["date_create"]) ?>
                </td>
                <td>
                  <?php echo $obj["code"] ?>
                </td>
                <td>
                  <?php echo $obj["num_get"] ?>
                </td>
                <td>
                  <strong><?php echo empty($status[$obj['status']]) ? '' : $status[$obj['status']] ?></strong>
                </td>                
              </tr>
            <?php } ?>
          </tbody>
        </table>
        <div class="paging"><?php echo $paging_download ?></div>
      </ul>
    </fieldset>
  </div>
  <div id="user-favorite-tab" class="form_inputs ui-tabs-panel ui-widget-content ui-corner-bottom">
    <fieldset>
      <ul>
        <table border="0" class="table-list">
          <thead>
            <tr>
              <th><?php echo $this->lang->line("label.promotion.title") ?></th>
              <th><?php echo $this->lang->line("label.promotion.code") ?></th>
              <th><?php echo $this->lang->line("label.promotion.start_date") ?></th>
              <th><?php echo $this->lang->line("label.promotion.end_date") ?></th>
              <th><?php echo $this->lang->line("label.promotion.status") ?></th>
              <th><?php echo $this->lang->line("label.promotion.rate_point") ?></th>
            </tr>
          </thead>
          <tbody>
            <?php            
            foreach ($favorite_promotions as $obj) {
              ?>
              <tr>
                <td>
                  <a href="<?php echo site_url('admin/promotion/show/' . $obj['id']) ?>">
                    <?php echo $obj["title"] ?>
                  </a>
                </td>
                <td>
                  <?php echo $obj["code"] ?>
                </td>
                <td>
                  <?php echo empty($obj["start_date"]) ? '' : date($this->setting_model->item('date_format'), $obj["start_date"]) ?>
                </td>
                <td>
                  <?php echo empty($obj["end_date"]) ? '' : date($this->setting_model->item('date_format'), $obj["end_date"]) ?>
                </td><td>
                  <?php echo @$status[$obj["status"]] ?>
                </td><td>
                  <?php echo $obj["rate_point"] ?>
                </td>
              </tr>
            <?php } ?>
          </tbody>
        </table>
        <div class="paging"><?php echo $paging_favorite ?></div>
      </ul>
    </fieldset>
  </div>
</div>